// 主页
var app = getApp();
Page({
	data: {
		catalog:null
	},
	onShow: function(){

	},
	onLoad: function () {
		this.load();
	},
	load: function() {
		let self = this;
		app.api.request("catalogue",{bookId:1},function (err,data) {
			if(err){
				wx.showModal({
					title: '提示',
					content: err.message,
					showCancel: false
				});
			}else{
				self.setData({catalog:data})
			}
			console.log(self.data.catalog);
		})
	},
	// 重置
	reset: function() {
		return this;
	}
});
